import torch
import torchvision

vgg16 = torchvision.models.vgg16(weights=None)
# 方式一保存
torch.save(vgg16, "vgg16_model1.pth")
# 方式二保存
torch.save(vgg16.state_dict(), "vgg16_model2.pth")
